#include <cstdio>

int main() {
	int a[3], b[3], c[3];
	scanf("%d.%d.%d %d.%d.%d", &a[0], &a[1], &a[2], &b[0], &b[1], &b[2]);

	int carry = 0;
	int c2 = (a[2] + b[2]) % 29;
	carry = (a[2] + b[2]) / 29;
	int c1 = (a[1] + b[1] + carry) % 17;
	carry = (a[1] + b[1] + carry) / 17;
	int c0 = (a[0] + b[0] + carry);

	printf("%d.%d.%d\n", c0, c1, c2);

	return 0;
}
